﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DDW;
using DDW.Collections;
using System.Windows.Forms;
using System.ComponentModel;
using System.Drawing;
using UIDesigner.ControlProviders.Bases;

namespace UIDesigner.FieldHandlers.Bases
{
    public class Handlers
    {
        public delegate void RequestTypeHandler(string strName, out ConstructedTypeNode objType);
    }

    public interface IFieldHandler
    {
        bool IsNested { get; }
        bool IsAttributeType { get; }
        bool SupportsParent(IComponent ctrlParent);
        bool Handles(IComponent ctrlParent, IType objType, NodeCollection<AttributeNode> rgAttributes);
        List<string> GetControlOptions(IComponent ctrlParent, BaseNode objProperty);
        float PriorityNumber { get; }
        Type MetadataAttributeType { get; }
        void AddBindings(string strOption, Control ctrlBinding, BaseNode objBase, string strBindingSourceProperty);
        Control AddControls(string strOption, IComponent ctrlParent, BaseNode objBase, int nTabIndex, List<Rectangle> rgLocationRects, List<char> rgMnemonics);
        Control AddControls(string strOption, TableLayoutPanel ctrlParent, BaseNode objBase, int nTabIndex, List<TableLayoutPanelCellPosition> rgTableLayoutPanelCellPositions, List<char> rgMnemonics);
        Control AddDefaultControls(IComponent ctrlParent, BaseNode objBase, int nTabIndex, List<Rectangle> rgLocationRects, List<char> rgMnemonics);
        Control AddDefaultControls(TableLayoutPanel ctrlParent, BaseNode objBase, int nTabIndex, List<TableLayoutPanelCellPosition> rgTableLayoutPanelCellPositions, List<char> rgMnemonics);
        Control AddPreviewDefaultControls(IComponent ctrlParent, BaseNode objBase, int nTabIndex, List<Rectangle> rgLocationRects, List<char> rgMnemonics);
        Control AddPreviewDefaultControls(TableLayoutPanel ctrlParent, BaseNode objBase, int nTabIndex, List<TableLayoutPanelCellPosition> rgTableLayoutPanelCellPositions, List<char> rgMnemonics);
        Control AddPreviewControls(string strOption, IComponent ctrlParent, BaseNode objBase, int nTabIndex, List<Rectangle> rgLocationRects, List<char> rgMnemonics);
        Control AddPreviewControls(string strOption, TableLayoutPanel ctrlParent, BaseNode objBase, int nTabIndex, List<TableLayoutPanelCellPosition> rgTableLayoutPanelCellPositions, List<char> rgMnemonics);
        void NegotiateLayout(string strOption, IComponent ctrlParent, BaseNode objBase, LayoutMode eLayoutMode, ref int nTabIndex, out LayoutStyle eLayoutStyle, out int nLabelAlignment, out Size szControlSize);
    }
}
